package g11.testutil;

import static org.junit.Assert.assertNotNull;
import g11.dao.DAOException;
import g11.dao.EmployeeDAO;
import g11.dao.EmployeeDAOImpl;
import g11.mis.UserTypeEnum;
import g11.model.Employee;

import org.junit.Test;

public class initAdmin {

	@Test
	public void initAdminUser() throws DAOException {
		// init an admin user object
		Employee employeeAdmin = new Employee();
		employeeAdmin.setUsername("admin");
		employeeAdmin.setPassword("1234");
		byte type = (byte) UserTypeEnum.ADMIN.index();
		employeeAdmin.setType(type);
		employeeAdmin.setName("Administrator");
		employeeAdmin.setDepartment("Information");
		employeeAdmin.setTitle("System Admin");
		// persistent
		// persistent doctor object
		EmployeeDAO employeeDao = new EmployeeDAOImpl();
		Integer employeeAdminId = employeeDao.createEmployee(employeeAdmin);
		employeeAdmin = employeeDao.getEmployeeById(employeeAdminId);
		assertNotNull(employeeAdmin);
	}

}
